package com.kingyun.gpsinspection.purificationservice.facade.service.tdm;


import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.EmployeeVo;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.RedisValue;
import com.kingyun.gpsinspection.purificationservice.facade.model.tdm.*;

import java.util.List;

/**
 * 检查维修业务接口
 * Created by sugongche on 2017/1/21.
 */
public interface CheckRepairService {
    /**
     * 保存检查维修任务
     *
     * @param redisValue
     * @param employeeVo
     * @param checkRepair
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderList
     * @param taskRelation
     * @return
     */
    int save(RedisValue redisValue, EmployeeVo employeeVo, CheckRepair checkRepair, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderList, TaskRelation taskRelation);

    /**
     * 更新
     *
     * @param redisValue
     * @param employeeVo
     * @param checkRepair
     * @param taskLink
     * @param workOrderVoList
     * @return
     * @throws Exception
     */
    int update(RedisValue redisValue, EmployeeVo employeeVo, CheckRepair checkRepair, TaskLink taskLink, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderVoList);

    /**
     * 根据主键查询
     * @param checkRepairId
     * @return
     * @throws Exception
     */
    CheckRepair queryBeanById(String checkRepairId) throws Exception;

    /**
     * 根据主键查询包装类
     * @param checkRepairId
     * @return
     * @throws Exception
     */
    CheckRepairVo queryVoById(String checkRepairId) throws Exception;

    /**
     * 根据流程实例ID查询
     * @param piPiid
     * @return
     */
    CheckRepairVo findByVoPiPiid(String piPiid);

    /**
     * 审核
     *
     * @param redisValue
     * @param employeeVo
     * @param taskLink
     * @param workOrderList
     * @param checkRepair
     * @return
     */
    int saveByAudit(RedisValue redisValue, EmployeeVo employeeVo, TaskLink taskLink, List<WorkOrderVo> workOrderList, CheckRepair checkRepair);

    /**
     * 根据处理步骤保存信息
     * @param employeeVo
     * @param checkRepair
     * @param taskLink
     * @return
     */
    int saveByStep(RedisValue redisValue, EmployeeVo employeeVo, CheckRepair checkRepair, TaskLink taskLink);

    /**
     * 新建分析处理关联的检查维修任务：不走BPM
     * @param employeeVo
     * @param checkRepair
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderList
     * @param analysisProcessId
     * @return
     */
    int saveRelation(EmployeeVo employeeVo, CheckRepair checkRepair, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderList, String analysisProcessId);

    /**
     * 修改分析处理关联的检查维修任务页面：不走BPM
     * @param employeeVo
     * @param checkRepair
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderVoList
     * @return
     */
    int updateRelation(EmployeeVo employeeVo, CheckRepair checkRepair, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderVoList);

    /**
     * 发起BPM流程
     * @param redisValue
     * @param employeeVo
     * @param checkRepair
     * @param workOrderVoList
     */
    int launchBPM(RedisValue redisValue, EmployeeVo employeeVo, CheckRepair checkRepair, List<WorkOrderVo> workOrderVoList);
}
